export default (data: {
  title: string
  description?: string
  keywords?: string
  image?: string
  route?: string
}) => {
  const siteName = '我的网站'
  const baseUrl = 'https://example.com'

  useHead({
    title: `${data.title} | ${siteName}`,
    meta: [
      {
        name: 'description',
        content: data.description || `${data.title} - ${siteName}专业提供相关服务`
      },
      {
        name: 'keywords',
        content: data.keywords || `${data.title},${siteName}`
      },
      // Open Graph
      { property: 'og:title', content: data.title },
      { property: 'og:description', content: data.description || '' },
      { property: 'og:image', content: data.image || '/default-image.jpg' },
      { property: 'og:url', content: `${baseUrl}${data.route || useRoute().path}` },
    ],
    link: [
      { rel: 'canonical', href: `${baseUrl}${data.route || useRoute().path}` }
    ]
  })
}